﻿//------------------------------------------------------------
// Author: 烟雨迷离半世殇
// Mail: 1778139321@qq.com
// Data: 2019年12月30日 21:31:41
//------------------------------------------------------------

using System;


namespace NKG_MVVM_UI
{
    /// <summary>
    /// 其中的BindablePropertys集合起来就是他的Model
    /// </summary>
    public class Test01AViewModel : AViewModel
    {
        public BindableProperty<string> Text = new BindableProperty<string>();
        public BindableProperty<int> Image = new BindableProperty<int>();
        
        public BindableProperty<Test01Model> Test01Model = new BindableProperty<Test01Model>();
        
        public override void OnInit()
        {
            Test01Model.Value = new Test01Model();
            Console.WriteLine("Test01AViewModel被初始化了");
        }

        /// <summary>
        /// 外部调用更改Text
        /// </summary>
        /// <param name="content"></param>
        public void ChangeText(string content)
        {
            Text.Value = content;
        }
        
        public override void OnRecycle()
        {
            Console.WriteLine("Test01AViewModel被回收了");
        }
    }
}